package com.esyoga.yoyoga.enums;

/**
 * 用户类型
 * 0:学员
 * 1:教练
 * 2:场馆
 * 3:平台
 */
public enum UserTypeEn {

    /**
     * 0，学员
     */
    STUDENT( 0,"学员"),

    /**
     * 1，教练
     */
    TRAINER( 1,"教练"),

    /**
     * 2、场馆
     */
    GYM(2,"场馆"),

    /**
     * 3、平台
     */
    PLATFORM(3,"平台");




    private final int code;
    private final String desc;

    UserTypeEn(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static UserTypeEn getUserTypeEnByCode(Integer code){
        for(UserTypeEn userTypeEn : UserTypeEn.values()){
             if(userTypeEn.getCode()==code){
                return userTypeEn;
            }
        }
        return null;

    }

    @Override
    public String toString() {
        return "UserTypeEn{" +
                "code=" + code +
                ", desc='" + desc + '\'' +
                '}';
    }
}
